<template>
  <div id="app">
    <!-- <HeaderComponent /> -->
    <div v-show="!isMobile" class="draggable-handle handle" v-draggable>
      <MusicPlayer />
    </div>
    <MusicPlayer v-show="isMobile"/>

    <!-- <router-view/> -->
  </div>
</template>

<script>
// import HeaderComponent from '@/components/Header.vue'; // 引入Header组件
import MusicPlayer from '@/components/MusicPlayer.vue'; // 引入MusicPlayer组件

export default {
  name: 'App',
  components: {
    // HeaderComponent, // 注册Header组件
    MusicPlayer, // 注册MusicPlayer组件
  },
  data() {
    return {
      activeIndex: '/',
      playerPosition: [{}] // 用于存储拖动位置的数据
    };
  },
  computed: {
    isMobile() {
      return window.innerWidth <= 768; // 假设768px及以下为移动端
    }
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #333333; /* 修改文字颜色为暗色 */
  margin-top: 60px;
  background-color: #f9f9f9; /* 修改背景颜色为亮色 */
}

.el-header {
  background-color: #f9f9f9; /* 修改背景颜色为亮色 */
  color: #333333; /* 修改文字颜色为暗色 */
  line-height: 60px;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

.draggable-handle {
  position: absolute;
  right: 20px;
  top: 10px;
  width: 400px; /* 设置宽度 */
  height: 200px;
  cursor: move;
  z-index: 1000;
}
</style>